/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.lvyh.lightframe.tracer.core.common;

/**
 * @author lvyh 2021/05/17.
 */
public class TraceContants {

    public static final String DUBBO_TRACER_FILTER_PROVIDER = "dubboProviderTracerFilter";

    public static final String DUBBO_TRACER_FILTER_CONSUMER = "dubboConsumerTracerFilter";

    public static final String DUBBO_TRACER_FILTER_CODEC = "tracerCodec";

    public static final String TRACE_ID_ALIAS = "tcid";

    public static final String SPAN_ID_ALIAS = "spid";

    public static final String PARENT_SPAN_ID_ALIAS = "pspid";

    public static final String KAFKA_TOPIC = "kafka.topic";

    public static final String KAFKA_PARTITION = "kafka.partition";

    public static final String KAFKA_OFFSET = "kafka.offset";

    /**
     * 128/64 bit traceId lower-hex string (required)
     */
    public static final String TRACE_ID_KEY_HEAD = "HEAD-X-TraceId";
    /**
     * 64 bit spanId lower-hex string (required)
     */
    public static final String SPAN_ID_KEY_HEAD = "HEAD-X-SpanId";
    /**
     * 64 bit parentSpanId lower-hex string (absent on root span)
     */
    public static final String PARENT_SPAN_ID_KEY_HEAD = "HEAD-X-ParentSpanId";
    /**
     * "1" means report this span to the tracing system, "0" means do not. (absent means defer the
     * decision to the receiver of this header).
     */
    public static final String SAMPLED_KEY_HEAD = "HEAD-X-Sampled";

    /**
     * Baggage items prefix
     */
    public static final String BAGGAGE_KEY_PREFIX = "baggage-";

    public static final String DEFAULT_UTF8_ENCODING = "UTF-8";

    public static final String REMOTE_HOST = "remote.host";

    public static final String REMOTE_PORT = "remote.port";

    public static final String LOCAL_APP = "local.app";

    public static final String REMOTE_APP = "remote.app";

    public static final String REQUEST_URL = "request.url";

    public static final String METHOD = "method";

    public static final String REQ_SIZE = "req.size.bytes";

    public static final String PROTOCOL = "protocol";

    public static final String SERVICE = "service";

    public static final String RESULT_CODE = "result.code";

    public static final String RESP_SIZE = "resp.size.bytes";

    public static final String CURRENT_THREAD_NAME = "current.thread.name";

    public static final String LOCAL_HOST = "local.host";

    public static final String LOCAL_PORT = "local.port";

    public static final String RPC_INVOKE_TYPE = "rpc.invoke.type";

    public static final String RPC_TRACE_NAME = "rpc.tracer.dubbo";

    public static final String RESULT_CODE_SUCCESS = "200";

    public static final String RESULT_CODE_ERROR = "500";

    public static final String RESULT_CODE_TIME_OUT = "300";

    public static final String MDC_TRACEID = "LF-TraceId";

    public static final String MDC_SPANID = "LF-SpanId";
}
